package com.tencreat.mapper.mall;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tencreat.domain.mall.MallIntegralGoods;
import com.tencreat.domain.mall.dto.GoodsIntegralListAppDTO;
import com.tencreat.domain.mall.vo.ResIntegralGoodsDetailsAppVO;
import com.tencreat.domain.mall.vo.ResIntegralGoodsListAppVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * 积分商品Mapper接口
 *
 * @author tencreat
 * @date 2021-09-01
 */
@Repository
public interface MallIntegralGoodsMapper extends BaseMapper<MallIntegralGoods> {

    Page<ResIntegralGoodsListAppVO> pageList(@Param("page") Page<ResIntegralGoodsListAppVO> page, @Param("dto") GoodsIntegralListAppDTO dto);

    ResIntegralGoodsDetailsAppVO details(Long id);

    Page<Map<String, Object>> pcList(@Param("page") Page<Map<String, Object>> page, @Param("goodsName") String goodsName,
                                      @Param("count") Long count, @Param("beginTime") Date beginTime, @Param("endTime") Date endTime,
                                        @Param("zoneId") Integer zoneId,@Param("sortStr") String sortStr,@Param("sortDesc") String sortDesc,
                                     @Param("goodsId") Integer goodsId,@Param("supplierName") String supplierName
            );

    List<Map<String,Object>> integralZoneList();

    int updateNum(@Param("id") Long id,@Param("num") Integer num);

    BigDecimal queryTotal(@Param("date1") LocalDateTime date);
}
